package jccr;

/**
 * Coordinator object factory.
 * @author dpet
 *
 */
public class Coordinate {

	public Coordinate( DispatcherQueue queue ) {
		
		if ( queue == null )
			throw new IllegalArgumentException();
		
		_dispatcherQueue = queue;
	}
	
	public ReceiveCoordinator receive( RawPort port ) {
		return receive( port, false );
	}
	
	public ReceiveCoordinator receive( RawPort port, boolean persistent ) {
		return new ReceiveCoordinator(_dispatcherQueue, port, persistent);	
	}
	
	public ChoiceCoordinator choice( RawPort port1, RawPort port2 ) {
		return new ChoiceCoordinator(_dispatcherQueue, port1, port2);
	}
	
	DispatcherQueue _dispatcherQueue;
}
